<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Happy dong
 * Created Time: 2019-06-27 14:21
 * Modified Time: 2019-06-27 14:21
 * Version: 2.0
 */

namespace App\Modules\Order\Validators;

use Flower\Core\Repository\Contracts\ValidatorInterface;
use Flower\Core\Repository\Validator\LaravelValidator;

class AppointmentValidator extends LaravelValidator
{
	protected $rules = [
		ValidatorInterface::RULE_CREATE => [
			'store_id' => 'sometimes|required',
			'barber_id' => 'sometimes|required',
			'appointment_time' => 'required',
			'mobile' => 'sometimes|required|regex:/^1[345789][0-9]{9}$/',
		]
	];
	protected $messages = [
		'store_id.required' => '店铺id不能为空',
		'barber_id.required' => '理发师id不能为空',
		'appointment_time' => '预约时间不能为空',
		'mobile.required' => '手机号不能为空',
		'mobile.regex'    => '手机号格式不对,请修正后继续注册',
	];

}